﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

// NOTE: If you change the interface name "IsimpleWcf" here, you must also update the reference to "IsimpleWcf" in Web.config.
[ServiceContract]
public interface IsimpleWcf
{

    [OperationContract]
    ModuleManager ParseXmlObject(string strRptPath);
    [OperationContract(Name = "GetStatetics")]
    StatisticsReport GetStateReport(string strRptPath);
    [OperationContract(Name = "GetStateticsBymodule")]
    StatisticsReport GetStateReportByModule(string MdleName, string strRptPath);
    [OperationContract(Name = "GetStateticsByNameSpace")]
    StatisticsReport GetStateReportByNamespace(string MdleName, string NmsName, string strRptPath);
    [OperationContract(Name = "GetStateticsByClass")]
    StatisticsReport GetStateReportByClass(string MdleName, string NmsName, string clsName, string strRptPath);
    [OperationContract]
    IList<ClassInfo> GetClassInfo(string MdleName, string NmsName, string strRptPath);
    [OperationContract]
    IList<MethodInfo> GetMethodInfo(string MdleName, string NmsName, string clsName, string strRptPath);
    [OperationContract]
    IList<ClassInfo> GetClassInfoAppLevel(string strRptPath);
    [OperationContract]
    IList<NamespaceInfo> GetNamespaceInfoAll(string strRptPath);
    [OperationContract]
    IList<NamespaceInfo> GetNamespaceInfoAllByModule(string ModName, string strRptPath);
    [OperationContract]
    IList<ModNamespaceInfoAggr> GetModLevelNamespaceAggReport(string ModName, string strRptPath);
    //[OperationContract]
    //String GetNamespaceName();
    [OperationContract]
    IList<NamespaceClassInfoAggr> GetNmsLvlClassAggReport(string ModName, string NmsNmae, string strRptPath);
    [OperationContract]
    IList<ClassInfo> GetNmsLvlClassReport(string ModName, string NmsNmae, string strRptPath);
    [OperationContract]
    IList<ClassMethodInfoAggr> GetClsLvlMethodAggReport(string modName, string nsName, string clsName, string strRptPath);
    [OperationContract]
    IList<ClassInfo> GetClassInfoAppLevelSL(string modulename, string namespacename, string strRptPath);
    [OperationContract]
    IList<SourceCodeInfo> GetRawSourceCode(string modName, string nsName, string clsName, string strRptPath);
    [OperationContract]
    IList<LineItem> GetLineInfo(string modName, string nsName, string clsName, string strRptPath);
    [OperationContract]
    List<FileContainer> GetFileOnfo(string modName, string nsName, string clsName, string strRptPath);        
    
    
}


[DataContract]
public class ModuleManager
{
    [DataMember]
    public List<ModuleItem> ModuleItemCollection;
    [DataMember]
    public int CoveredClsCount;
    [DataMember]
    public int NCoverdClsCount;
    [DataMember]
    public double classCoveragePercentage;
    [DataMember]
    public int TotalClasses;
    [DataMember]
    public int TotalFiles;
    [DataMember]
    public double AvgClsFile;
    [DataMember]
    public double AvgMethodClass;
    [DataMember]
    public int Lines;
    [DataMember]
    public int NClines;
    [DataMember]
    public DateTime FileCreationTime;
    [DataMember]
    public string ModuleName;
    [DataMember]
    public List<SourceFileItem> SrcFileItemCollection;
}
[DataContract]
public class ModuleItem
{
    [DataMember]
    public string ModuleName;
    [DataMember]
    public int LinesCovered;
    [DataMember]
    public int LinesNotCovered;
    [DataMember]
    public int LinesPartiallycovered;
    [DataMember]
    public int BlocksCovered;
    [DataMember]
    public int BlocksNotCovered;
    [DataMember]
    public List<NameSpaceItem> NameSpaceItemCollection;
}

[DataContract]
public class NameSpaceItem
{
    [DataMember]
    public string NameSpaceName;
    [DataMember]
    public int LinesCovered;
    [DataMember]
    public int LinedPartiallyCovered;
    [DataMember]
    public int LinesNotCovered;
    [DataMember]
    public int BlocksCovered;
    [DataMember]
    public int BlocksNotCovered;
    [DataMember]
    public List<ClassItem> ClassItemCollection;
    [DataMember]
    public double NamespaceCovPercentage;
}


[DataContract]
public class ClassItem
{
    [DataMember]
    public string ClassName;
    [DataMember]
    public int LinesCovered;
    [DataMember]
    public int LinesPartiallyCovered;
    [DataMember]
    public int LinesNotCovered;
    [DataMember]
    public int BlocksCovered;
    [DataMember]
    public int BlocksNotCovered;
    [DataMember]
    public List<MethodItem> MethodItemCollection;
}

[DataContract]
public class MethodItem
{
    [DataMember]
    public string MethodName;
    [DataMember]
    public int LinesCoved;
    [DataMember]
    public int LinedPartiallyCovered;
    [DataMember]
    public int LinesNotCovered;
    [DataMember]
    public int BlocksCovered;
    [DataMember]
    public int BlocksNotCovered;
    [DataMember]
    public List<LineItem> LineItemCollection;

}
[DataContract]
public class LineItem
{
    [DataMember]
    public int LnStart;
    [DataMember]
    public int ColStart;
    [DataMember]
    public int LnEnd;
    [DataMember]
    public int ColEnd;
    [DataMember]
    public int Coverage;
    [DataMember]
    public int SourceFileID;
    [DataMember]
    public int LineID;
}
[DataContract]
public class SourceFileItem
{
    [DataMember]
    public int SrcFileId;
    [DataMember]
    public string StrFilePath;
}

[DataContract]
public class StatisticsReport
{
    [DataMember]
    public string Name;
    [DataMember]
    public int LOC;
    [DataMember]
    public int NCLOC;
    [DataMember]
    public int PLOC;
    [DataMember]
    public int BlocksCov;
    [DataMember]
    public int BlocksNt;
    [DataMember]
    public int TotClsCov;
    [DataMember]
    public int TotNClsCov;
    [DataMember]
    public double AvgMtdClass;
    [DataMember]
    public double AvgLnsMtd;
}

[DataContract]
public class ClassInfo
{
    [DataMember]
    public string ModuleName;
    [DataMember]
    public string NamespaceName;
    [DataMember]
    public string Classname;
    [DataMember]
    public double CovPercentage;
    [DataMember]
    public double AvgLnsMtd;
    [DataMember]
    public double TotalLines;

}

[DataContract]
public class NamespaceInfo
{
    [DataMember]
    public string ModuleName;
    [DataMember]
    public string NamespaceName;
    [DataMember]
    public double NsCovPercentage;
    [DataMember]
    public double AvgClsFile;
    [DataMember]
    public double AvgMtdClass;
    [DataMember]
    public int TotFiles;
    [DataMember]
    public int TotClasses;
    [DataMember]
    public int CovLines;
    [DataMember]
    public int NCLines;
}
[DataContract]
public class ModNamespaceInfoAggr
{
    [DataMember]
    public string ModuleName;
    [DataMember]
    public DateTime FileCreationTime;
    [DataMember]
    public double classCoveragePercentage;
    [DataMember]
    public double AvgClsFile;
    [DataMember]
    public double AvgMethodClass;
    [DataMember]
    public int TotalFiles;
    [DataMember]
    public int TotalClasses;
    [DataMember]
    public int Lines;
    [DataMember]
    public int NClines;
}

[DataContract]
public class NamespaceClassInfoAggr
{
    [DataMember]
    public string NamespaceName;
    [DataMember]
    public double CovPercentage;
    [DataMember]
    public double AvgLnsMtds;

}
[DataContract]
public class ClassMethodInfoAggr
{
    [DataMember]
    public string ClassName;
    [DataMember]
    public double covPercentage;
    [DataMember]
    public int totLines;
}


[DataContract]
public class MethodInfo
{
    [DataMember]
    public string Methodname;
    [DataMember]
    public double CovPercentage;
    [DataMember]
    public double ClsCovPercentage;
    [DataMember]
    public int LineNumber;
    [DataMember]
    public int TotalLines;
    [DataMember]
    public string FileName;
}
[DataContract]
public class SourceCodeInfo
{
    [DataMember]
    public int LineNumber;
    [DataMember]
    public string CodeString;
    //karthik change
    [DataMember]
    public string CovStatus;

}
//karthik change
[DataContract]
public class FileContainer
{
    [DataMember]
    public List<SourceCodeInfo> SrcCodeInfoCollection;
    [DataMember]
    public string FileName;
}
